<template>
  <div class="exmsg-bg">
      <div class="m-bg">
        <div class="content">
            <div class="text">
              <div class="text1">{{$store.state.msg_title}}</div>
              <div class="text2">{{$store.state.msg_content}}</div>
            </div>
            <div class="btn">
              <img @click="hide()" src="../../assets/img/wozhidaoleanniu.png"/>
            </div>
        </div>
      </div>
  </div>
</template>

<script>
import '../../assets/css/index.less'
import { mapMutations, mapGetters, mapActions } from 'vuex'
import base from '../../constant/base'
export default {
  name: 'msg',
  methods:{
      hide:function(){
        if(this.$store.state.msg_toUrl!=""){
          let url = this.$store.state.msg_toUrl
          this.$store.state.msg_toUrl = ""
          window.location.href = url
        }else if(this.$store.state.msg_u!=""){
          let u = this.$store.state.msg_u
          this.$store.state.msg_u = ""
          this.$router.push(u)
        }else{
          this.hideMsg()
          this.$store.state.msg_toUrl = ""
          this.$store.state.msg_u = ""
        }
      },
      show:function(){
        this.showMsg()
      },
      ...mapMutations({                 //引入 修改状态的方法  就可以用 this.setSinger()     //来进行修改状态(状态改变会自动渲染你所关联的组件)         
            hideMsg: 'HIDE_MSG',
            showMsg: 'SHOW_MSG'
    }),
  }

}
</script>